#!/usr/bin/bash

# -----------

# alias archivebox='python3 -m archivebox'
alias archivebox='docker run -v $PWD:/data -it nikisweeting/archivebox'
alias archivebox-server="docker run -v $PWD:/data -it -p 8000:8000 nikisweeting/archivebox server 0.0.0.0:8000
open http://127.0.0.1:8000"

alias xss='xss-lock -l ~/.config/i3/transfer-sleep-lock-i3lock.sh -- i3lock-fancy -p &'
alias wsc='sudo systemctl start windscribe.service && sleep 1 && windscribe connect best'
alias wsd='sudo systemctl stop windscribe.service && sleep 1 && windscribe disconnect'

alias mount='sudo mount'
alias umount='sudo umount'

alias grep="grep -i --color=always"
alias free='free -m'
alias cp="cp -i" 
alias rm="rm -rvf"
alias srm="sudo rm -rfv"
alias df='df -h'
alias rdu="sudo ncdu / --exclude '/home' --exclude '/swapfile'"
alias hdu="ncdu $HOME"
alias neofetch="clear && neofetch"
alias q="exit"
alias cal="cal -3 -m"

mkcd () { mkdir -p "$1"; cd "$1" }

alias {v,vi}="$EDITOR"
alias svi="sudo $EDITOR"

alias m="ncmpcpp"
alias h="htop"
alias yt="straw-viewer"
alias fm="ranger"
alias rss="newsboat"

alias ytx="youtube-dl --extract-audio --audio-format mp3 "

alias xdg-file="xdg-mime query filetype $1"
alias get-mime="xdg-mime query default $1"
alias set-mime="xdg-mime default $1 $2"

alias vga="lspci -k | grep -A 2 -E '(VGA|3D)'"
alias speed="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -"
alias fonts="fc-list | cut -d: -f1 | sort| uniq"

alias gpg-import='gpg --keyserver keys.gnupg.net --recv-keys'
alias ref="sudo reflector -c "Russia" -c "Belarus" -c "Ukraine" -c "Poland" -f 20 -l 20 -p https -p http -n 20 --save /etc/pacman.d/mirrorlist --sort rate"

alias merge="xrdb -merge $HOME/.Xresources"
alias sshg="ssh-keygen -t rsa -b 4096 -C $1 && ssh-copy-id $1"

alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
alias update-mkinitcpio="sudo mkinitcpio -p linux"

alias qemu-run="qemu-system-x86_64 -m 4096 -enable-kvm -hda"

################################################################################
# -----------------------------      OTHER      ------------------------------ #
################################################################################

alias ll='exa -al --color=always --group-directories-first'
alias la='exa -a --color=always --group-directories-first'
alias ls='exa -l --color=always --group-directories-first'
alias lt='exa -aT --color=always --group-directories-first'
alias l.='exa -a | egrep "^\."'

alias /="cd /"
alias ~="cd ~"
alias ..="cd .."
alias ...="cd ../.."

alias hh="sudo systemctl hibernate"
alias eh="$EDITOR $HOME/hosts/myhosts"
alias sz="source $HOME/.zshrc"
alias ez="$EDITOR $HOME/.zshrc"
alias eaz="$EDITOR $HOME/.alias_zsh"
alias ev="$EDITOR $HOME/.vimrc"


################################################################################
# ------------------------------      GIT      ------------------------------- #
################################################################################

alias config='git --git-dir=/home/st/.dotfiles/ --work-tree=/home/st'

alias gs="git status"
alias glog="git log --stat --pretty=oneline --graph --date=short"
alias gd="git diff"
alias gad="git add --all"
alias gc="git commit -m $1"
alias gac="gad && gc"
alias gr="git restore"
alias gpm="git push origin master"
alias gp="git push"
alias gam="git add . && git commit --amend"

alias g-undo="git reset --soft HEAD~"
alias g-ssh="git remote add origin git@github.com:$1.git"


alias ys="yay"
alias y="yay -Sy"
alias yn="yay -S --noconfirm"
alias yr="yay -Rs"
alias yrn="yay -Rs --noconfirm"
alias yu="yay -Qu" 

# ------------

alias rve="sudo rm -rvf .venv"

alias ve="virtualenv .venv"
alias vea="source .venv/bin/activate"
alias ved="deactivate"

alias pir="pip install -r requirements.txt"
alias ver="pip freeze > requirements.txt"

alias vef="rve && ve && vea && pir"

